<template>
	<view class="qrcode">
      <u--image
        v-if="list.length > 0"
        @click="previewImage"
        width="100%"
        height="100%"
        mode="widthFix"
        lazy-load :fade="true" duration="450" :src="baseUrl + list[0]"></u--image>
  </view>
</template>

<script>
// import color from '@/config/color.js'
import config from '../../config/config'
import base64 from '../../util/base64'
import User from '../../api/user'
const userModel = new User()

	export default {
		data() {
			return {
        baseUrl: config.baseUrl,
			  list: []
			}
		},
		onLoad() {
		  this.fetch()
		},
		methods: {
		  fetch() {
        userModel.qrcodeList(/*{ scene: 1195 }*/).then(response => {
          let { data } = response
          data = base64.parse(data)
          console.log(data)
          this.list = data.list
        })
      },
      previewImage() {
        uni.previewImage({
          urls: [this.baseUrl + this.list[0]],
        })
      }
		}
	}
</script>

<style lang="scss" scoped>
.content {
  height: 10100px;
  background: black;
  margin-top: 10px;
}
</style>
